<?php
/**
 * Created by PhpStorm.
 * User: gzc0918
 * Date: 2021-08-06
 * Time: 23:37
 */

namespace IMooc;

//注册器模式
class Register
{
    protected static $objects;
    static function set( $alias, $object)
    {
        self::$objects[$alias] = $object;
    }
    static function get($name)
    {
        if(!isset(self::$objects[$name])){
            return null;
        }
        return self::$objects[$name];
    }
    function _unset($alias)
    {
        unset(self::$objects[$alias]);
    }
}